#include <iostream>
using namespace std;

class student_t {
  private:
    const char *m_name;
    int         m_age;
    float       m_score;

  public:
    student_t(const char *name, int age, float score);

  public:
    void  show();
    const char *getname() const;
    int   getage() const;
    float getscore() const;
};

student_t::student_t(const char *name, int age, float score) : m_name(name), m_age(age), m_score(score)
{
}
void student_t::show()
{
    cout << m_name << "的年龄是" << m_age << "，成绩是" << m_score << endl;
}
const char *student_t::getname() const
{
    return m_name;
}
int student_t::getage() const
{
    return m_age;
}
float student_t::getscore() const
{
    return m_score;
}

int main()
{
    const student_t stu("小明", 15, 90.6);
    // stu.show();  //error
    cout << stu.getname() << "的年龄是" << stu.getage() << "，成绩是" << stu.getscore() << endl;

    const student_t *pstu = new student_t("李磊", 16, 80.5);
    // pstu -> show();  //error
    cout << pstu->getname() << "的年龄是" << pstu->getage() << "，成绩是" << pstu->getscore() << endl;

    return 0;
}
